﻿@using VocaDb.Model.Domain.PVs
@using VocaDb.Web.Helpers
@* Binding context: PVEditViewModel, parent context: PVListEditViewModel *@

<tr>
	<td>
		<a href="{{url}}">
			<img data-bind="attr: { src: $parent.pvServiceIcons.getIconUrl(service) }" alt="{{service}}" />
			{{service}}
		</a>
	</td>
	<td>
		@foreach (var pvType in Translate.PVTypeNames) {
			<span visible="{{ pvType == '@pvType.Id.ToString()' }}">@pvType.Name</span>
		}
	</td>
	<td>
		<input type="text" data-bind="textInput: name" size="40" maxlength="200" class="input-xlarge" />
	</td>
	<td>
		{{ length | formatLengthSeconds }}
	</td>	
	<td visible="{{ $parent.showPublishDates }}">
		{{#if $parent.showPublishDates }}
		{{ publishDate | formatDate:'l' }}
		{{/if}}
	</td>	
	<td>
		{{#if author && $parent.canBulkDeletePVs}}
			<a href="{{ $parent.urlMapper.mapRelative('/Admin/PVsByAuthor?author=' + author) }}">{{author}}</a>
		{{/if}}
		{{#ifnot author && $parent.canBulkDeletePVs}}
			{{ author }}
		{{/if}}
	</td>
	<td visible="{{ $parent.allowDisabled }}">
		<span visible="{{ pvType === '@PVType.Original.ToString()' }}">
			<input type="checkbox" checked="{{ disabled }}"/>
			@ViewRes.EntryEditStrings.PVUnavailable
		</span>
	</td>
	<td>
		<a data-bind="click: $parent.remove" class="textLink deleteLink" href="#">@ViewRes.SharedStrings.Delete</a>
	</td>
</tr>
